local sk__gangzhi = fk.CreateSkill {

  name = "sk__gangzhi",

  tags = {  },

}



sk__gangzhi:addEffect(fk.DamageInflicted, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk__gangzhi.name)
  end,
  on_cost = function(self, event, target, player, data)
    local prompt = "#sk__gangzhi1-invoke"
    if player:isKongcheng() then
      prompt = "#sk__gangzhi2-invoke"
    end
    return player.room:askForSkillInvoke(player, sk__gangzhi.name, nil, prompt)
  end,
  on_use = function(self, event, target, player, data)
    if not player:isKongcheng() then
      player:throwAllCards("h")
      return true
    else
      player:turnOver()
      if not player.dead and player.maxHp > player:getHandcardNum() then
        player:drawCards(player.maxHp - player:getHandcardNum(), sk__gangzhi.name)
      end
    end
  end,
})

return sk__gangzhi